﻿using System.Threading;
using System.Threading.Tasks;

namespace K9Nano.Authorization
{
    public interface IUserBackListManager
    {
        /// <summary>
        /// 禁止用户登录指定的客户端
        /// </summary>
        /// <param name="userIdOrPhone"></param>
        /// <param name="clients"></param>
        /// <param name="reason"></param>
        /// <param name="cancellation"></param>
        /// <returns></returns>
        ValueTask ForbidAsync(string userIdOrPhone, string[] clients, string reason, CancellationToken cancellation);

        /// <summary>
        /// 禁止用户登录所有客户端
        /// </summary>
        /// <param name="userIdOrPhone"></param>
        /// <param name="reason"></param>
        /// <param name="cancellation"></param>
        /// <returns></returns>
        ValueTask ForbidAsync(string userIdOrPhone, string reason, CancellationToken cancellation);

        /// <summary>
        /// 禁止用户登录指定的客户端
        /// </summary>
        /// <param name="userIdOrPhone"></param>
        /// <param name="clients"></param>
        /// <param name="cancellation"></param>
        /// <returns></returns>
        ValueTask AllowAsync(string userIdOrPhone, string[] clients, CancellationToken cancellation);

        /// <summary>
        /// 允许用户登录所有客户端
        /// </summary>
        /// <param name="userIdOrPhone"></param>
        /// <param name="cancellation"></param>
        /// <returns></returns>
        ValueTask AllowAsync(string userIdOrPhone, CancellationToken cancellation);
    }
}